/**
 * meiguang8.com
 * Copyright (C) 2016-2019 All Rights Reserved.
 */
package com.yuanchuang.yp.mall.web.admin.common.enums;

/**
 * @author yuanyuan.zhu
 * @version AccountTypeEnum.java, v 0.1 2019-07-11 15:31 yuanyuan.zhu
 */
public enum AccountTypeEnum {
    MOBILE("手机登录",1),
    EMAIL("邮箱",2),
    UNKNOWN("未知类型",-1);

    private String name;
    private Integer value;

    AccountTypeEnum(String name, Integer value) {
        this.name = name;
        this.value = value;
    }

    /**
     * Getter method for property <tt>name</tt>.
     *
     * @return property value of name
     */
    public String getName() {
        return name;
    }

    /**
     * Getter method for property <tt>value</tt>.
     *
     * @return property value of value
     */
    public Integer getValue() {
        return value;
    }

    public static AccountTypeEnum getByValue(Integer value) {
        AccountTypeEnum[] valueList = AccountTypeEnum.values();
        for (AccountTypeEnum v : valueList) {
            if (v.getValue().equals(value)) {
                return v;
            }
        }
        return null;
    }
}
